import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'package:get/get.dart';
import 'package:signage/app/data/models/board_element.dart';
import 'package:signage/l10n/l10n.dart';
import 'package:signage/widgets/custom_appbar.dart';

import '../controllers/transfer_controller.dart';

class TransferView extends GetView<TransferController> {
  const TransferView({super.key});
  @override
  Widget build(BuildContext context) {
    final l10n = AppLocalizations.of(context)!;
    
    return Scaffold(
      backgroundColor: const Color(0xFFF3F4F6),
      appBar: CustomAppBar(
        title: l10n.translate('transfer_settings'),
        showBackButton: true,
        backgroundColor: Colors.white,
      ),
      body: Container(
        margin: EdgeInsets.all(16),
        padding: EdgeInsets.all(16),
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(8),
        ),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Obx(() => Text(
                  l10n.translate('max_connections')
                      .replaceFirst('{count}', controller.maxConnections.value.toString()),
                  style: const TextStyle(
                    fontSize: 16,
                    fontWeight: FontWeight.w400,
                    letterSpacing: 0,
                    color: Color(0xFF333333),
                  ),
                )),
            const SizedBox(height: 8),
            Text(
              l10n.translate('connection_speed_hint'),
              style: TextStyle(
                color: Color(0xFF999999),
                fontSize: 14,
              ),
            ),
            const SizedBox(height: 16),
            Obx(() => SliderTheme(
                  data: SliderThemeData(
                    activeTrackColor: Color.fromRGBO(242, 242, 242, 1),
                    inactiveTrackColor: Color.fromRGBO(242, 242, 242, 1),
                    thumbColor: Color.fromRGBO(255, 255, 255, 1),
                    trackHeight: 30.h,
                    thumbShape: RoundSliderThumbShape(enabledThumbRadius: 10,disabledThumbRadius: 4),
                  ),
                  child: Slider(
                    value: controller.maxConnections.value.toDouble(),
                    min: 1,
                    max: 6,
                    onChanged: (value) {
                    controller.updateMaxConnections(value.toInt());
                  },
                ))),
          ],
        ),
      ),
    );
  }
}
